package 动态规划;

import java.util.Scanner;

/**
 * @Author: biubiu0002
 * @Date: 2021-03-22 19:06
 **/
public class 一维数组dp跳阶梯 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        System.out.println(f(n));

    }

    public static int f(int n){
        if(n<=2)
            return n;
        //创建一个数组来保存历史数据
        int[] dp = new int[n+1];
        dp[1]=1;
        dp[2]=2;
        int i;
        for(i=3;i<=n;i++){
            dp[i]=dp[i-1]+dp[i-2];
        }
        return dp[--i];


    }

}
